package com.miniportal.base.constant.impl;

import com.miniportal.base.constant.BaseEnum;
import lombok.AllArgsConstructor;

import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 园区枚举
 *
 * @author Guo Shuai
 * @version 1.0
 * @date 2022/5/19
 */
@AllArgsConstructor
public enum ParkEnum implements BaseEnum {

    /**
     * 金盘数字经济园
     **/
    PARK_ONE("10", "金盘数字经济园"),
    /**
     * 中谷产业园
     **/
    PARK_TWO("11", "中谷产业园"),
    /**
     * 清华科创产业园
     **/
    PARK_THREE("12", "清华科创产业园"),
    /**
     * 磐安产业园
     **/
    PARK_FOUR("13", "磐安产业园");

    private final String value;
    private final String description;

    private static final ConcurrentHashMap<String, String> PARK_MAP;

    static {
        PARK_MAP = new ConcurrentHashMap<>();
        Arrays.stream(values()).forEach(item -> PARK_MAP.put(item.getValue(), item.getDescription()));
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    /**
     * 通过value获取描述
     *
     * @param value
     * @return java.lang.String
     * @author Guo Shuai
     * @date 2022/5/19
     * @since 1.0
     **/
    public static String getDescription(String value) {
        return PARK_MAP.get(value);
    }
}
